authorAccess.getWorkspaceAccess().showErrorMessage("Start operation");

var nodeAtOffset = controller.getNodeAtOffset(authorAccess.getEditorAccess().getCaretOffset());
while (nodeAtOffset.getName() != "таблица")
    nodeAtOffset = nodeAtOffset.getParent();

globalObject.setAttrValue(nodeAtOffset, "border-top", null);
globalObject.setAttrValue(nodeAtOffset, "border-right", null);
globalObject.setAttrValue(nodeAtOffset, "border-bottom", null);
globalObject.setAttrValue(nodeAtOffset, "border-left", null);


    var rows = globalObject.node2element(nodeAtOffset).getElementsByLocalName("строка");
    var tenpRow = 0;
    var isRowspan = false;
    for (var r = 0; r < rows.length; r++){//rows
        var cells = rows[r].getElementsByLocalName("ячейка");
        for (var c = 0; c < cells.length; c++){//cells
            
            /*globalObject.setAttrValue(cells[c], "border-top", null);
            globalObject.setAttrValue(cells[c], "border-right", null);
            globalObject.setAttrValue(cells[c], "border-bottom", null);
            globalObject.setAttrValue(cells[c], "border-left", null);*/
            
            var realColumn = c;
            if (realColumn == 0) {
                var rowspan = parseInt(cells[c].getAttribute("rowspan"));
                if (rowspan > 0){
                    rowspan--;
                    realColumn = c + 1;
                }
            }
            
            var bordersForCell = globalObject.getBorderInfoForCell(r, c);
            var borderAttrs = globalObject.parse(bordersForCell, "1px solid #000000");
            var bordersKeys = borderAttrs.keySet().toArray();
            for (var a = 0; a < bordersKeys.length; a++){
                var borderName = bordersKeys[a];
                var borderValue = borderAttrs.get(borderName);
                if (borderValue == "") borderValue = null;
                //authorAccess.getWorkspaceAccess().showErrorMessage("" + borderName + "=" + borderValue);
                
                try {
                    globalObject.setAttrValue(cells[c], borderName, borderValue);
                } catch (err) {
                    authorAccess.getWorkspaceAccess().showErrorMessage(err.description);
                }
            }
            
            /*var attrCount = cells[iii].getAttributesCount();
            for (var a = 0; a < attrCount; a++){//attrs
                var attrName = cells[iii].getAttributeAtIndex(a);
                
            }*/
        }
        //authorAccess.getWorkspaceAccess().showErrorMessage(cells[ii].getAttribute("id").getValue());
    }

